var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            if (cm.getNumberFromQuestInfo(37520, "dir") > 0) {
                cm.npc_ChangeController(3004435, "oid=63706617", -400, 180, 14, -450, -350, 0, true, 0, false);
                cm.npc_SetSpecialAction("oid=63706617", "summon", 0, 0);
                cm.npc_ChangeController(3004436, "oid=63706618", -500, 180, 5, -550, -450, 0, true, 0, false);
                cm.npc_SetSpecialAction("oid=63706618", "summon", 0, 0);
                cm.npc_ChangeController(3004481, "oid=63706619", -600, 180, 13, -650, -550, 0, false, 0, false);
                cm.npc_SetSpecialAction("oid=63706619", "summon", 0, 0);
                cm.npc_ChangeController(3004441, "oid=63706620", 24, 180, 1, -26, 74, 1, true, 0, false);
                cm.npc_SetSpecialAction("oid=63706620", "summon", 0, 0);
                cm.npc_ChangeController(3004430, "oid=63706621", -69, 180, 2, -119, -19, 0, true, 0, false);
                cm.npc_SetSpecialAction("oid=63706621", "summon", 0, 0);
                cm.npc_ChangeController(3004439, "oid=63706622", 300, 180, 19, 250, 350, 1, true, 0, false);
                cm.npc_SetSpecialAction("oid=63706622", "summon", 0, 0);
                cm.npc_ChangeController(3004439, "oid=63706623", 400, 180, 20, 350, 450, 1, true, 0, false);
                cm.npc_SetSpecialAction("oid=63706623", "summon", 0, 0);
                cm.npc_ChangeController(3004439, "oid=63706624", 500, 180, 21, 450, 550, 1, true, 0, false);
                cm.npc_SetSpecialAction("oid=63706624", "summon", 0, 0);
                cm.dispose();
                return
            }
            cm.npc_ChangeController(3004424, "oid=377737", 475, 180, 0, 425, 525, 1, false, 0, false);
            cm.npc_ChangeController(3004424, "oid=377738", 540, 200, 0, 490, 590, 1, false, 0, false);
            cm.npc_ChangeController(3004423, "oid=377739", -495, 195, 0, -545, -445, 0, false, 0, false);
            cm.npc_ChangeController(3004423, "oid=377740", -430, 180, 0, -480, -380, 0, false, 0, false);
            cm.npc_ChangeController(3004518, "oid=377741", -231, 245, 3, -281, -181, 0, false, 0, false);
            cm.npc_ChangeController(3004300, "oid=377742", -923, 245, 7, -964, -873, 1, false, 0, false);
            cm.npc_ChangeController(3004435, "oid=63705423", -400, 180, 14, -450, -350, 0, true, 0, false);
            cm.npc_SetSpecialAction("oid=63705423", "summon", 0, 0);
            cm.npc_ChangeController(3004436, "oid=63705426", -500, 180, 5, -550, -450, 0, true, 0, false);
            cm.npc_SetSpecialAction("oid=63705426", "summon", 0, 0);
            cm.npc_ChangeController(3004481, "oid=63705427", -600, 180, 13, -650, -550, 0, false, 0, false);
            cm.npc_SetSpecialAction("oid=63705427", "summon", 0, 0);
            cm.npc_ChangeController(3004441, "oid=63705429", 24, 180, 1, -26, 74, 1, true, 0, false);
            cm.npc_SetSpecialAction("oid=63705429", "summon", 0, 0);
            cm.npc_ChangeController(3004430, "oid=63705430", -69, 180, 2, -119, -19, 0, true, 0, false);
            cm.npc_SetSpecialAction("oid=63705430", "summon", 0, 0);
            cm.npc_ChangeController(3004439, "oid=63705431", 300, 180, 19, 250, 350, 1, true, 0, false);
            cm.npc_SetSpecialAction("oid=63705431", "summon", 0, 0);
            cm.npc_ChangeController(3004439, "oid=63705432", 400, 180, 20, 350, 450, 1, true, 0, false);
            cm.npc_SetSpecialAction("oid=63705432", "summon", 0, 0);
            cm.npc_ChangeController(3004439, "oid=63705433", 500, 180, 21, 450, 550, 1, true, 0, false);
            cm.npc_SetSpecialAction("oid=63705433", "summon", 0, 0);
            cm.curNodeEventEnd(true);
            cm.eventSKill(0);
            cm.setInGameDirectionMode(true, false, true);
            cm.inGameDirectionEvent_SetAdditionalEffectVisibleForInGameDirection2();
            cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
            cm.setStandAloneMode(true);
            cm.inGameDirectionEvent_AskAnswerTime(2000);
            cm.curNodeEventEnd(true)
        } else {
            if (status === a++) {
                cm.fieldEffect_InsertCanvas(1, 255, 0, 0, 0, 0, 0);
                cm.inGameDirectionEvent_AskAnswerTime(1200)
            } else {
                if (status === a++) {
                    cm.fieldEffect_InsertCanvas(0, 0, 0, 0, 0, 2000, 0);
                    cm.inGameDirectionEvent_AskAnswerTime(2500)
                } else {
                    if (status === a++) {
                        cm.inGameDirectionEvent_AskAnswerTime(5000);
                        cm.effect_Text(["#fn黑体##fs18#战争结束几天后。"], [100, 1000, 6, -50, -50, 1, 4, 0, 0, 0, 0])
                    } else {
                        if (status === a++) {
                            cm.eventSKill(0);
                            cm.warp(993150200, 0, true);
                            cm.setInGameDirectionMode(false, true, false);
                            cm.setStandAloneMode(false);
                            cm.updateInfoQuest(37520, "dir=1");
                            cm.npc_LeaveField("oid=63705423");
                            cm.npc_LeaveField("oid=63705423");
                            cm.npc_LeaveField("oid=63705426");
                            cm.npc_LeaveField("oid=63705426");
                            cm.npc_LeaveField("oid=63705427");
                            cm.npc_LeaveField("oid=63705427");
                            cm.npc_LeaveField("oid=63705429");
                            cm.npc_LeaveField("oid=63705429");
                            cm.npc_LeaveField("oid=63705430");
                            cm.npc_LeaveField("oid=63705430");
                            cm.npc_LeaveField("oid=63705431");
                            cm.npc_LeaveField("oid=63705431");
                            cm.npc_LeaveField("oid=63705432");
                            cm.npc_LeaveField("oid=63705432");
                            cm.npc_LeaveField("oid=63705433");
                            cm.npc_LeaveField("oid=63705433");
                            cm.dispose()
                        }
                    }
                }
            }
        }
    }
};